package com.feelingj.spring.boot.blog.service;

import java.util.Optional;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.feelingj.spring.boot.blog.domain.Comment;
import com.feelingj.spring.boot.blog.repository.CommentRepository;

/**
 * 
 * @ClassName:CommentService
 * @Description:TODO
 * @author feelj
 * @date 2018年4月1日上午23:19:00
 */
@Service
public class CommentServiceImpl implements CommentService {

	@Autowired
    private CommentRepository commentRepository;
    
	@Override
	public Optional<Comment> getCommentById(Long id) {
		return commentRepository.findById(id);
	}

	@Override
	public void removeComment(Long id) {
		commentRepository.deleteById(id);
	}

}
